﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;

using PdfSharp;
using PdfSharp.Drawing;
using PdfSharp.Pdf;
using PdfSharp.Pdf.IO;
using CE.Mail;
using CE.Image;
using CE.Global;
using CE.Database;
using CE.CreditCard;
using CE.User;
using CE.PostCode;
using CE.CarInsurance;
using CE.Provider;
using CE.Security;


/// <summary>
/// Summary description for HsbcCarInsurancePDFOutput
/// </summary>
public class HsbcCarInsurancePDFOutput
{
    private string _pageTitle;
    public string PageTitle
    {
        get { return _pageTitle; }
        set { _pageTitle = value; }
    }

    private string _proposalNo;
    public string ProposalNo
    {
        get { return _proposalNo; }
        set { _proposalNo = value; }
    }

    private string _revisionNo;
    public string RevisionNo
    {
        get { return _revisionNo; }
        set { _revisionNo = value; }
    }

    private string _quotationNo;
    public string QuotationNo
    {
        get { return _quotationNo; }
        set { _quotationNo = value; }
    }

    private string _producerCode;
    public string ProducerCode
    {
        get { return _producerCode; }
        set { _producerCode = value; }
    }

    private DateTime _Applicationdate;
    public DateTime ApplicationDate
    {
        get { return _Applicationdate; }
        set { _Applicationdate = value; }
    }


    #region Customer Profile

    private string _customerName;
    public string CustomerName
    {
        get { return _customerName; }
        set { _customerName = value; }
    }

    private string _customerdob;
    public string CustomerDOB
    {
        get { return _customerdob; }
        set { _customerdob = value; }
    }

    //DateTime _customerdob;
    //public DateTime CustomerDOB
    //{
    //    get { return _customerdob; }
    //    set { _customerdob = value; }
    //}

    private string _nationality;
    public string Nationality
    {
        get { return _nationality; }
        set { _nationality = value; }
    }

    private string _nric;
    public string NRIC
    {
        get { return _nric; }
        set { _nric = value; }
    }

    private string _drvlicenceobtained;
    public string DrvLicenceObtained
    {
        get { return _drvlicenceobtained; }
        set { _drvlicenceobtained = value; }
    }

    string _customermaritalstatus;
    public string CustomerMaritalStatus
    {
        get { return _customermaritalstatus; }
        set { _customermaritalstatus = value; }
    }

    string _customergender;
    public string CustomerGender
    {
        get { return _customergender; }
        set { _customergender = value; }
    }

    string _customeraddress;
    public string CustomerAddress
    {
        get { return _customeraddress; }
        set { _customeraddress = value; }
    }

    string _customerunitno;
    public string CustomerUnitNo
    {
        get { return _customerunitno; }
        set { _customerunitno = value; }
    }

    string _customerhomeno;
    public string CustomerHomeNo
    {
        get { return _customerhomeno; }
        set { _customerhomeno = value; }
    }

    string _customerpostcode;
    public string CustomerPostCode
    {
        get { return _customerpostcode; }
        set { _customerpostcode = value; }
    }

    string _customeroccupation;
    public string CustomerOccupation
    {
        get { return _customeroccupation; }
        set { _customeroccupation = value; }
    }

    string _customerjobnature;
    public string CustomerJobNature
    {
        get { return _customerjobnature; }
        set { _customerjobnature = value; }
    }

    string _mobileno;
    public string MobileNo
    {
        get { return _mobileno; }
        set { _mobileno = value; }
    }

    string _homephoneno;
    public string HomePhoneNo
    {
        get { return _homephoneno; }
        set { _homephoneno = value; }
    }

    string _officeno;
    public string OfficeNo
    {
        get { return _officeno; }
        set { _officeno = value; }
    }

    string _faxno;
    public string FaxNo
    {
        get { return _faxno; }
        set { _faxno = value; }
    }

    string _employersname;
    public string EmployersName
    {
        get { return _employersname; }
        set { _employersname = value; }
    }

    string _emailaddress;
    public string EmailAddress
    {
        get { return _emailaddress; }
        set { _emailaddress = value; }
    }

    #endregion

    #region ClaimDetails

    string _accidentdate;
    public string AccidentDate
    {
        get { return _accidentdate; }
        set { _accidentdate = value; }
    }

    string _natureofaccident;
    public string NatureofAccident
    {
        get { return _natureofaccident; }
        set { _natureofaccident = value; }
    }

    string _claimamount;
    public string ClaimAmount
    {
        get { return _claimamount; }
        set { _claimamount = value; }
    }

    string _typeofclaim;
    public string TypeofClaim
    {
        get { return _typeofclaim; }
        set { _typeofclaim = value; }
    }

    string _last3yearsClaimXP;
    public string Last3YearsClaimXP
    {
        get { return _last3yearsClaimXP; }
        set { _last3yearsClaimXP = value; }
    }

    string _noClaimsLast3Years;
    public string NoClaimsLast3Years
    {
        get { return _noClaimsLast3Years; }
        set { _noClaimsLast3Years = value; }
    }

    string _claimsAmount1;
    public string ClaimsAmount1
    {
        get { return _claimsAmount1; }
        set { _claimsAmount1 = value; }
    }

    string _claimsAmount2;
    public string ClaimsAmount2
    {
        get { return _claimsAmount2; }
        set { _claimsAmount2 = value; }
    }

    string _claimsAmount3;
    public string ClaimsAmount3
    {
        get { return _claimsAmount3; }
        set { _claimsAmount3 = value; }
    }

    string _NCDPercent;
    public string NCDPercent
    {
        get { return _NCDPercent; }
        set { _NCDPercent = value; }
    }

    string _NCDProtector;
    public string NCDProtector
    {
        get { return _NCDProtector; }
        set { _NCDProtector = value; }
    }

    string _ncdNilDetails;
    public string NCDNilDetails
    {
        get { return _ncdNilDetails; }
        set { _ncdNilDetails = value; }
    }


    string _isrevoked;
    public string IsRevoked
    {
        get { return _isrevoked; }
        set { _isrevoked = value; }
    }

    string _revokedyear;
    public string RevokedYear
    {
        get { return _revokedyear; }
        set { _revokedyear = value; }
    }

    string _revokedreason;
    public string RevokedReason
    {
        get { return _revokedreason; }
        set { _revokedreason = value; }
    }

    string _isNCD;
    public string IsNCD
    {
        get { return _isNCD; }
        set { _isNCD = value; }
    }

    #endregion

    #region Vehicle Details

    string _vehicleNo;
    public string VehicleNo
    {
        get { return _vehicleNo; }
        set { _vehicleNo = value; }
    }

    string _carMake;
    public string CarMake
    {
        get { return _carMake; }
        set { _carMake = value; }
    }

    string _carModel;
    public string CarModel
    {
        get { return _carModel; }
        set { _carModel = value; }
    }

    Int32 _carCC;
    public Int32 CarCC
    {
        get { return _carCC; }
        set { _carCC = value; }
    }

    string _engineType;
    public string EngineType
    {
        get { return _engineType; }
        set { _engineType = value; }
    }

    Int32 _carSeaters;
    public Int32 CarSeaters
    {
        get { return _carSeaters; }
        set { _carSeaters = value; }
    }

    Int32 _yearOfRegistration;
    public Int32 YearOfRegistration
    {
        get { return _yearOfRegistration; }
        set { _yearOfRegistration = value; }
    }

    string _offPeakCar;
    public string OffPeakCar
    {
        get { return _offPeakCar; }
        set { _offPeakCar = value; }
    }

    string _withoutCOEPARF;
    public string WithOutCOEPARF
    {
        get { return _withoutCOEPARF; }
        set { _withoutCOEPARF = value; }
    }

    string _bodyType;
    public string BodyType
    {
        get { return _bodyType; }
        set { _bodyType = value; }
    }

    string _purchasePrice;
    public string PurchasePrice
    {
        get { return _purchasePrice; }
        set { _purchasePrice = value; }
    }

    string _engineNo;
    public string EngineNo
    {
        get { return _engineNo; }
        set { _engineNo = value; }
    }

    string _chassisNo;
    public string ChassisNo
    {
        get { return _chassisNo; }
        set { _chassisNo = value; }
    }

    Int32 _yearOfManufacture;
    public Int32 YearOfManufacture
    {
        get { return _yearOfManufacture; }
        set { _yearOfManufacture = value; }
    }

    string _purposeOfUse;
    public string PurposeOfUse
    {
        get { return _purposeOfUse; }
        set { _purposeOfUse = value; }
    }

    #endregion

    #region Other Info

    string _isCarModified;
    public string IsCarModified
    {
        get { return _isCarModified; }
        set { _isCarModified = value; }
    }

    string _modifiedReason;
    public string ModifiedReason
    {
        get { return _modifiedReason; }
        set { _modifiedReason = value; }
    }

    bool _isHPCompany;
    public bool IsHPCompany
    {
        get { return _isHPCompany; }
        set { _isHPCompany = value; }
    }

    string _hpCompanyName;
    public string HPCompanyName
    {
        get { return _hpCompanyName; }
        set { _hpCompanyName = value; }
    }

    bool _socialUse;
    public bool SocialUse
    {
        get { return _socialUse; }
        set { _socialUse = value; }
    }

    string _insStartDate;
    public string InsStartDate
    {
        get { return _insStartDate; }
        set { _insStartDate = value; }
    }

    string _insEndDate;
    public string InsEndDate
    {
        get { return _insEndDate; }
        set { _insEndDate = value; }
    }

    string _ownDamageExcess;
    public string OwnDamageExcess
    {
        get { return _ownDamageExcess; }
        set { _ownDamageExcess = value; }
    }

    string _planName;
    public string PlanName
    {
        get { return _planName; }
        set { _planName = value; }
    }


    bool _isConvictedOfMotoringOffense;
    public bool IsConvictedOfMotoringOffense
    {
        get { return _isConvictedOfMotoringOffense; }
        set { _isConvictedOfMotoringOffense = value; }
    }

    string _convictedReason;
    public string ConvictedReason
    {
        get { return _convictedReason; }
        set { _convictedReason = value; }
    }

    bool _isGivenDemeritPoints;
    public bool IsGivenDemeritPoints
    {
        get { return _isGivenDemeritPoints; }
        set { _isGivenDemeritPoints = value; }
    }

    string _demeritPointsReason;
    public string DemeritPointsReason
    {
        get { return _demeritPointsReason; }
        set { _demeritPointsReason = value; }
    }

    bool _isDisabled;
    public bool isDisabled
    {
        get { return _isDisabled; }
        set { _isDisabled = value; }
    }

    string _disablityReason;
    public string DisablityReason
    {
        get { return _disablityReason; }
        set { _disablityReason = value; }
    }

    bool _isRefusedMotorInsurance;
    public bool IsRefusedMotorInsurance
    {
        get { return _isRefusedMotorInsurance; }
        set { _isRefusedMotorInsurance = value; }
    }

    string _refusedReason;
    public string RefusedReason
    {
        get { return _refusedReason; }
        set { _refusedReason = value; }
    }

    bool _isTerminatedDueToPayment;
    public bool IsTerminatedDueToPayment
    {
        get { return _isTerminatedDueToPayment; }
        set { _isTerminatedDueToPayment = value; }
    }

    string _terminatedReason;
    public string TerminatedReason
    {
        get { return _terminatedReason; }
        set { _terminatedReason = value; }
    }



    #endregion

    #region Addtnal Drivers

    string _driver1Name;
    public string Driver1Name
    {
        get { return _driver1Name; }
        set { _driver1Name = value; }
    }

    string _driver1Gender;
    public string Driver1gender
    {
        get { return _driver1Gender; }
        set { _driver1Gender = value; }
    }

    string _driver1DOB;
    public string Driver1DOB
    {
        get { return _driver1DOB; }
        set { _driver1DOB = value; }
    }


    private string _driver1licenceobtained;
    public string Driver1LicenceObtained
    {
        get { return _driver1licenceobtained; }
        set { _driver1licenceobtained = value; }
    }

    string _driver1Occupation;
    public string Driver1Occupation
    {
        get { return _driver1Occupation; }
        set { _driver1Occupation = value; }
    }


    string _driver1relationshiptoProposer;
    public string Driver1RelationshipToProposer
    {
        get { return _driver1relationshiptoProposer; }
        set { _driver1relationshiptoProposer = value; }
    }
    string _driver1isrevoked;
    public string Driver1IsRevoked
    {
        get { return _driver1isrevoked; }
        set { _driver1isrevoked = value; }
    }

    string _driver1revokedyear;
    public string Driver1RevokedYear
    {
        get { return _driver1revokedyear; }
        set { _driver1revokedyear = value; }
    }

    string _driver1revokedreason;
    public string Driver1RevokedReason
    {
        get { return _driver1revokedreason; }
        set { _driver1revokedreason = value; }
    }
    string _driver1isfaultclaim;
    public string Driver1IsFaultClaim
    {
        get { return _driver1isfaultclaim; }
        set { _driver1isfaultclaim = value; }
    }

    string _driver1JobNature;
    public string Driver1JobNature
    {
        get { return _driver1JobNature; }
        set { _driver1JobNature = value; }
    }

    string _driver1MaritalStatus;
    public string Driver1MaritalStatus
    {
        get { return _driver1MaritalStatus; }
        set { _driver1MaritalStatus = value; }
    }

    Int32 _driver1DrivingExperience;
    public Int32 Driver1DrivingExperience
    {
        get { return _driver1DrivingExperience; }
        set { _driver1DrivingExperience = value; }
    }

    String _driver1accidentdate;
    public String Driver1AccidentDate
    {
        get { return _driver1accidentdate; }
        set { _driver1accidentdate = value; }
    }

    String _driver1natureofaccident;
    public String Driver1NatureofAccident
    {
        get { return _driver1natureofaccident; }
        set { _driver1natureofaccident = value; }
    }

    String _driver1claimamount;
    public String Driver1ClaimAmount
    {
        get { return _driver1claimamount; }
        set { _driver1claimamount = value; }
    }

    String _driver1typeofclaim;
    public string Driver1TypeofClaim
    {
        get { return _driver1typeofclaim; }
        set { _driver1typeofclaim = value; }
    }



    string _driver2Name;
    public string Driver2Name
    {
        get { return _driver2Name; }
        set { _driver2Name = value; }
    }

    string _driver2Gender;
    public string Driver2gender
    {
        get { return _driver2Gender; }
        set { _driver2Gender = value; }
    }

    string _driver2DOB;
    public string Driver2DOB
    {
        get { return _driver2DOB; }
        set { _driver2DOB = value; }
    }

    private string _driver2licenceobtained;
    public string Driver2LicenceObtained
    {
        get { return _driver2licenceobtained; }
        set { _driver2licenceobtained = value; }
    }

    string _driver2Occupation;
    public string Driver2Occupation
    {
        get { return _driver2Occupation; }
        set { _driver2Occupation = value; }
    }

    string _driver2relationshiptoProposer;
    public string Driver2RelationshipToProposer
    {
        get { return _driver2relationshiptoProposer; }
        set { _driver2relationshiptoProposer = value; }
    }

    string _driver2isrevoked;
    public string Driver2IsRevoked
    {
        get { return _driver2isrevoked; }
        set { _driver2isrevoked = value; }
    }

    string _driver2revokedyear;
    public string Driver2RevokedYear
    {
        get { return _driver2revokedyear; }
        set { _driver2revokedyear = value; }
    }

    string _driver2revokedreason;
    public string Driver2RevokedReason
    {
        get { return _driver2revokedreason; }
        set { _driver2revokedreason = value; }
    }
    string _driver2isfaultclaim;
    public string Driver2IsFaultClaim
    {
        get { return _driver2isfaultclaim; }
        set { _driver2isfaultclaim = value; }
    }

    string _driver2JobNature;
    public string Driver2JobNature
    {
        get { return _driver2JobNature; }
        set { _driver2JobNature = value; }
    }

    string _driver2MaritalStatus;
    public string Driver2MaritalStatus
    {
        get { return _driver2MaritalStatus; }
        set { _driver2MaritalStatus = value; }
    }

    Int32 _driver2DrivingExperience;
    public Int32 Driver2DrivingExperience
    {
        get { return _driver2DrivingExperience; }
        set { _driver2DrivingExperience = value; }
    }

    String _driver2accidentdate;
    public String Driver2AccidentDate
    {
        get { return _driver2accidentdate; }
        set { _driver2accidentdate = value; }
    }

    String _driver2natureofaccident;
    public String Driver2NatureofAccident
    {
        get { return _driver2natureofaccident; }
        set { _driver2natureofaccident = value; }
    }

    String _driver2claimamount;
    public String Driver2ClaimAmount
    {
        get { return _driver2claimamount; }
        set { _driver2claimamount = value; }
    }

    String _driver2typeofclaim;
    public string Driver2TypeofClaim
    {
        get { return _driver2typeofclaim; }
        set { _driver2typeofclaim = value; }
    }

    string _driver3Name;
    public string Driver3Name
    {
        get { return _driver3Name; }
        set { _driver3Name = value; }
    }

    string _driver3Gender;
    public string Driver3gender
    {
        get { return _driver3Gender; }
        set { _driver3Gender = value; }
    }

    string _driver3DOB;
    public string Driver3DOB
    {
        get { return _driver3DOB; }
        set { _driver3DOB = value; }
    }

    private string _driver3licenceobtained;
    public string Driver3LicenceObtained
    {
        get { return _driver3licenceobtained; }
        set { _driver3licenceobtained = value; }
    }

    string _driver3Occupation;
    public string Driver3Occupation
    {
        get { return _driver3Occupation; }
        set { _driver3Occupation = value; }
    }

    string _driver3JobNature;
    public string Driver3JobNature
    {
        get { return _driver3JobNature; }
        set { _driver3JobNature = value; }
    }

    string _driver3MaritalStatus;
    public string Driver3MaritalStatus
    {
        get { return _driver3MaritalStatus; }
        set { _driver3MaritalStatus = value; }
    }

    Int32 _driver3DrivingExperience;
    public Int32 Driver3DrivingExperience
    {
        get { return _driver3DrivingExperience; }
        set { _driver3DrivingExperience = value; }
    }

    String _driver3accidentdate;
    public String Driver3AccidentDate
    {
        get { return _driver3accidentdate; }
        set { _driver3accidentdate = value; }
    }

    String _driver3natureofaccident;
    public String Driver3NatureofAccident
    {
        get { return _driver3natureofaccident; }
        set { _driver3natureofaccident = value; }
    }

    String _driver3claimamount;
    public String Driver3ClaimAmount
    {
        get { return _driver3claimamount; }
        set { _driver3claimamount = value; }
    }

    String _driver3typeofclaim;
    public string Driver3TypeofClaim
    {
        get { return _driver3typeofclaim; }
        set { _driver3typeofclaim = value; }
    }

    string _driver4Name;
    public string Driver4Name
    {
        get { return _driver4Name; }
        set { _driver4Name = value; }
    }

    string _driver4Gender;
    public string Driver4gender
    {
        get { return _driver4Gender; }
        set { _driver4Gender = value; }
    }

    string _driver4DOB;
    public string Driver4DOB
    {
        get { return _driver4DOB; }
        set { _driver4DOB = value; }
    }

    string _driver4Occupation;
    public string Driver4Occupation
    {
        get { return _driver4Occupation; }
        set { _driver4Occupation = value; }
    }

    string _driver4JobNature;
    public string Driver4JobNature
    {
        get { return _driver4JobNature; }
        set { _driver4JobNature = value; }
    }

    string _driver4MaritalStatus;
    public string Driver4MaritalStatus
    {
        get { return _driver4MaritalStatus; }
        set { _driver4MaritalStatus = value; }
    }

    Int32 _driver4DrivingExperience;
    public Int32 Driver4DrivingExperience
    {
        get { return _driver4DrivingExperience; }
        set { _driver4DrivingExperience = value; }
    }

    string _driver5Name;
    public string Driver5Name
    {
        get { return _driver5Name; }
        set { _driver5Name = value; }
    }

    string _driver5Gender;
    public string Driver5gender
    {
        get { return _driver5Gender; }
        set { _driver5Gender = value; }
    }

    string _driver5DOB;
    public string Driver5DOB
    {
        get { return _driver5DOB; }
        set { _driver5DOB = value; }
    }

    string _driver5Occupation;
    public string Driver5Occupation
    {
        get { return _driver5Occupation; }
        set { _driver5Occupation = value; }
    }

    string _driver5JobNature;
    public string Driver5JobNature
    {
        get { return _driver5JobNature; }
        set { _driver5JobNature = value; }
    }

    string _driver5MaritalStatus;
    public string Driver5MaritalStatus
    {
        get { return _driver5MaritalStatus; }
        set { _driver5MaritalStatus = value; }
    }

    Int32 _driver5DrivingExperience;
    public Int32 Driver5DrivingExperience
    {
        get { return _driver5DrivingExperience; }
        set { _driver5DrivingExperience = value; }
    }



    #endregion

    #region Policy Details

    string _financeCo;
    public string FinanceCo
    {
        get { return _financeCo; }
        set { _financeCo = value; }
    }

    string _usage;
    public string Usage
    {
        get { return _usage; }
        set { _usage = value; }
    }

    string _typeofcover;
    public string TypeOfCover
    {
        get { return _typeofcover; }
        set { _typeofcover = value; }
    }

    DateTime _periodFrom;
    public DateTime PeriodFrom
    {
        get { return _periodFrom; }
        set { _periodFrom = value; }
    }

    DateTime _periodTo;
    public DateTime PeriodTo
    {
        get { return _periodTo; }
        set { _periodTo = value; }
    }


    string _currentInsuranceCo;
    public string CurrentInsuranceCo
    {
        get { return _currentInsuranceCo; }
        set { _currentInsuranceCo = value; }
    }

    string _policyNo;
    public string PolicyNo
    {
        get { return _policyNo; }
        set { _policyNo = value; }
    }

    DateTime _expiryCancellationDate;
    public DateTime ExpiryCancellationDate
    {
        get { return _expiryCancellationDate; }
        set { _expiryCancellationDate = value; }
    }

    #endregion

    #region Payment Details

    int _excess;
    public int Excess
    {
        get { return _excess; }
        set { _excess = value; }
    }

    string _totalPremium;
    public string TotalPremium
    {
        get { return _totalPremium; }
        set { _totalPremium = value; }
    }

    string _installmentType;
    public string InstallmentType
    {
        get { return _installmentType; }
        set { _installmentType = value; }
    }

    string _cardType;
    public string CardType
    {
        get { return _cardType; }
        set { _cardType = value; }
    }

    string _cardNo;
    public string CardNo
    {
        get { return _cardNo; }
        set { _cardNo = value; }
    }

    string _cardExpiryMonth;
    public string CardExpiryMonth
    {
        get { return _cardExpiryMonth; }
        set { _cardExpiryMonth = value; }
    }

    string _cardExpiryYear;
    public string CardExpiryYear
    {
        get { return _cardExpiryYear; }
        set { _cardExpiryYear = value; }
    }

    string _cardholdersName;
    public string CardholdersName
    {
        get { return _cardholdersName; }
        set { _cardholdersName = value; }
    }

    string _issuingBank;
    public string IssuingBank
    {
        get { return _issuingBank; }
        set { _issuingBank = value; }
    }


    #endregion

	public HsbcCarInsurancePDFOutput()
	{
		//
		// TODO: Add constructor logic here
		//
	}


    private void DrawBoxWithText(XGraphics _objG, XColor _xcolor, int x, int y, int width, int height, double borderWidth, string strText, string strFontName, double fontSize, XFontStyle xFontStyle)
    {

        System.Drawing.Rectangle _rect = new System.Drawing.Rectangle(0, 0, 0, 0);
        _rect.X = x;
        _rect.Y = y;
        _rect.Width = width;
        _rect.Height = height;
        XPen _pen = new XPen(_xcolor);
        _pen.Width = borderWidth;
        XFont font = new XFont(strFontName, fontSize, xFontStyle);
        _objG.DrawRectangle(_pen, _rect);
        _objG.DrawString(strText, font, XBrushes.Black, _rect, XStringFormats.Center);
    }
    


    private void DrawBoxWithText(XGraphics _objG, XColor _xcolor, int x, int y, int width, int height, double borderWidth, string strText, string strFontName, double fontSize, XFontStyle xFontStyle, XSolidBrush xSolidBrush)
    {

        System.Drawing.Rectangle _rect = new System.Drawing.Rectangle(0, 0, 0, 0);
        _rect.X = x + 1;
        _rect.Y = y + 1;
        _rect.Width = width - 2;
        _rect.Height = height - 1;


        XPen _pen = new XPen(_xcolor);
        _pen.Width = borderWidth;
        XFont font = new XFont(strFontName, fontSize, xFontStyle);
        //_objG.DrawRectangle(_pen, _rect);
        _objG.DrawRectangle(xSolidBrush, _rect);
        _objG.DrawString(strText, font, XBrushes.Black, _rect, XStringFormats.Center);

    }

    private void DrawBoxWithTextList(XGraphics _objG, XColor _xcolor, int x, int y, int width, int height, int rows, int cols, double borderWidth, string strFontName, double fontSize, XFontStyle xFontStyle, string[,] _arrData, int[] _arrColsWidth)
    {

        System.Drawing.Rectangle _rect = new System.Drawing.Rectangle(0, 0, 0, 0);
        _rect.X = x;
        _rect.Y = y;
        _rect.Width = width;
        _rect.Height = (height + 8) * rows;

        XColor _xOuterBoxColor = new XColor();
        _xOuterBoxColor.R = 0;
        _xOuterBoxColor.G = 0;
        _xOuterBoxColor.B = 0;

        XPen _pen = new XPen(_xcolor);
        _pen.Width = borderWidth;
        XFont font = new XFont(strFontName, fontSize, xFontStyle);
        XFont boldFont = new XFont(strFontName, fontSize, XFontStyle.Bold);
        _objG.DrawRectangle(_pen, _rect);

        System.Drawing.Rectangle _rectText = new System.Drawing.Rectangle(0, 0, 0, 0);
        _rectText.X = x + 5;
        _rectText.Y = y + 5;
        _rectText.Width = width;
        _rectText.Height = height;

        for (int i = 0; i < rows; i++)
        {
            // Draw the text
            for (int j = 0; j < cols; j++)
            {
                _rectText.Width = _arrColsWidth[j];
                if (j == 0)
                {
                    _objG.DrawString(_arrData[i, j].ToString(), boldFont, XBrushes.Black, _rectText, XStringFormats.TopLeft);
                }
                else
                {
                    _objG.DrawString(_arrData[i, j].ToString(), font, XBrushes.Black, _rectText, XStringFormats.TopLeft);
                }
                _rectText.X += _arrColsWidth[j];
            }
            _rectText.X = x + 5;
            _rectText.Y += height + 5;
        }

    }

    private void DrawTable(XGraphics _objG, int x, int y, int rows, int cols, int rowHeight, int[] _arrColsWidth, string[] _arrHeader, string[,] _arrData)
    {
        XColor _xcolor = new XColor();
        _xcolor.R = 0;
        _xcolor.G = 0;
        _xcolor.B = 0;
        System.Drawing.Rectangle _rect = new System.Drawing.Rectangle(0, 0, 0, 0);
        _rect.X = x;
        _rect.Y = y;
        _rect.Width = _arrColsWidth[0];
        _rect.Height = rowHeight;
        XPen _pen = new XPen(_xcolor);
        _pen.Width = 0.5d;
        XFont font = new XFont("Verdana", 5, XFontStyle.Regular);

        for (int h = 0; h < cols; h++)
        {
            _rect.Width = _arrColsWidth[h];
            _objG.DrawRectangle(_pen, _rect);
            _objG.DrawString(_arrHeader[h].ToString(), font, XBrushes.Black,
      new XRect(_rect.X + 3, _rect.Y + 3, 10, 10),
      XStringFormats.TopLeft);
            _rect.X += _arrColsWidth[h];
        }

        _rect.Y += rowHeight;
        _rect.X = x;

        for (int i = 0; i < rows; i++)
        {
            // Draw the text
            for (int j = 0; j < cols; j++)
            {
                _rect.Width = _arrColsWidth[j];

                _objG.DrawRectangle(_pen, _rect);
                _objG.DrawString(_arrData[i, j].ToString(), font, XBrushes.Black,
          new XRect(_rect.X + 3, _rect.Y + 3, 10, 10),
          XStringFormats.TopLeft);
                _rect.X += _arrColsWidth[j];
            }
            _rect.Y += rowHeight;
            _rect.X = x;
        }
    }

    public string GetFilePathHsbc()
    {
        string _filePath = CE.Configuration.MyConfigurationManager.GetAppSettingValue("FileOutputPath").ToString();
        _filePath += "pdfoutput\\hsbc\\";
        CE.InputOut.MyIO _myIO = new CE.InputOut.MyIO();
        string _todaydate = CE.Global.General.GetUTCDateTime().ToString("yyyyMMMdd");
        if (!_myIO.CheckDirectory(_filePath + _todaydate))
        {
            if (_myIO.CreateDirectory(_filePath, _todaydate))
            {
                _filePath += _todaydate + "\\";
            }
        }
        else
        {
            _filePath += _todaydate + "\\";
        }

        return _filePath;
    }

    private string isTrue(string ibool)
    {
        string retval = "Yes";

        if (ibool == "False")
            retval = "No";

        return retval;
    }

    public string HsbcPDFProposalForm(string strfilename)
    {
        // Create a new PDF document
        PdfDocument document = new PdfDocument();
        document.Info.Title = _pageTitle;

        // Create an empty page
        PdfPage page = document.AddPage();

        // Get an XGraphics object for drawing
        XGraphics gfx = XGraphics.FromPdfPage(page);
        //XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);

        // Create a font
        //XFont font = new XFont("Verdana", 8, XFontStyle.Bold);
        //XFont fontNormal = new XFont("Verdana", 8, XFontStyle.Regular);
        //XFont fontMedium = new XFont("Verdana", 7, XFontStyle.Regular);
        //XFont fontSmall = new XFont("Verdana", 6, XFontStyle.Regular);
        //XFont fontBold = new XFont("Verdana", 8, XFontStyle.Bold);
        //XFont fontMediumBold = new XFont("Verdana", 7, XFontStyle.Bold);
        //XFont fontSmallBold = new XFont("Verdana", 6, XFontStyle.Bold);
        String str = string.Empty;
        XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);
        // Create a font
        XFont font = new XFont("Verdana", 8, XFontStyle.Bold, options);
        XFont fontNormal = new XFont("Verdana", 7.5, XFontStyle.Regular, options);
        XFont fontMedium = new XFont("Verdana", 7, XFontStyle.Regular, options);
        XFont fontSmall = new XFont("Verdana", 6, XFontStyle.Regular, options);
        XFont fontBold = new XFont("Verdana", 8, XFontStyle.Bold, options);
        XFont fontMediumBold = new XFont("Verdana", 7, XFontStyle.Bold,options);
        XFont fontSmallBold = new XFont("Verdana", 6, XFontStyle.Bold);
       
        XColor _xcolor = new XColor();
        _xcolor.R = 0;
        _xcolor.G = 0;
        _xcolor.B = 0;

        System.Drawing.Rectangle _rect = new System.Drawing.Rectangle(20, 10, 500, 100);
        XPen _pen = new XPen(_xcolor);

        int curX = 35;
        int curY = 35;

        gfx.DrawImage(XImage.FromFile(AppDomain.CurrentDomain.BaseDirectory + "images\\pdf\\header_hsbcbank.gif"), new XRect(curX, curY, 545, 57));
        curY += 60;

        gfx.DrawString("Company registration no. 195400150N", fontSmall, XBrushes.Black, new XRect(curX, curY-5, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString("Statement pursuant to the Insurance Act (Cap. 142)", fontMediumBold, XBrushes.Red, new XRect(curX, curY + 15, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString("You are to disclose in this proposal form fully and faithfully all the facts which you", fontMedium, XBrushes.Red, new XRect(curX, curY + 25, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString("know or ought to know, otherwise the policy issued hereunder may be void.", fontMedium, XBrushes.Red, new XRect(curX, curY + 35, 100, 20), XStringFormat.TopLeft);

        DrawBoxWithText(gfx, _xcolor, curX + 320, curY, 230, 45, 1.0, "", "Verdana", 7.0, XFontStyle.Regular);
        curY += 2;
        gfx.DrawString(" Agency name/Agency no.:", fontNormal, XBrushes.Black, new XRect(curX + 320, curY, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        DrawBoxWithText(gfx, _xcolor, curX + 320, curY + 10, 230, 0, 1.0, "", "Verdana", 7.0, XFontStyle.Regular);
        curY += 2;
        gfx.DrawString(" Quotation no.:", fontNormal, XBrushes.Black, new XRect(curX + 320, curY + 10, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_quotationNo + " (CompareXpress)", fontNormal, XBrushes.DarkBlue, new XRect(curX + 400, curY + 10, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        DrawBoxWithText(gfx, _xcolor, curX + 320, curY + 20, 230, 0, 1.0, "", "Verdana", 7.0, XFontStyle.Regular);
        curY += 2;
        gfx.DrawString(" For Official use only:", fontNormal, XBrushes.Black, new XRect(curX + 320, curY + 20, 100, 20), XStringFormat.TopLeft);
        curY += 6;

#region "Section 1. Details of Proposer Start"
        
        DrawBoxWithText(gfx, _xcolor, curX, curY + 35, 550, 295, 1.0, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX, curY + 35, 550, 14, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);
        curY += 2;
        gfx.DrawString(" 1. Details of proposer", fontBold, XBrushes.Black, new XRect(curX, curY + 35, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        DrawBoxWithText(gfx, _xcolor, curX, curY + 45, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;
        DrawBoxWithText(gfx, _xcolor, curX, curY + 43, 285, 114, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;
        DrawBoxWithText(gfx, _xcolor, curX, curY + 70, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX, curY + 110, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX, curY + 135, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX, curY + 155, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);

        gfx.DrawString(" Name (as shown in NRIC / Passport, please underline surname)", fontNormal, XBrushes.Black, new XRect(curX, curY + 41, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_customerName, fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 55, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Date of birth", fontNormal, XBrushes.Black, new XRect(curX + 285, curY + 41, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_customerdob, fontNormal, XBrushes.DarkBlue, new XRect(curX + 287, curY + 55, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Nationality (where applicable)", fontNormal, XBrushes.Black, new XRect(curX + 400, curY + 41, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_nationality, fontNormal, XBrushes.DarkBlue, new XRect(curX + 402, curY + 55, 100, 20), XStringFormat.TopLeft);

        DrawBoxWithText(gfx, _xcolor, curX + 285, curY + 41, 115, 29, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX + 285, curY + 70, 140, 65, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX + 285, curY + 90, 265, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;

        gfx.DrawString(" Address", fontNormal, XBrushes.Black, new XRect(curX, curY + 68, 100, 20), XStringFormat.TopLeft);
        
        if (_customeraddress.Length > 40)
        {
            string[] _address = _customeraddress.Split(',');
            if (_address.Length > 3)
            {
                string _secondline = _address[1].ToString() + "," + _address[2].ToString();
                gfx.DrawString(" #" + _customerunitno + " - " + _customerhomeno + ", " + _address[0].ToString() + ",", fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 78, 100, 20), XStringFormat.TopLeft);
                if (_secondline.Length > 45)
                {
                    gfx.DrawString(_secondline.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 3, curY + 88, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(" Postal code", fontNormal, XBrushes.Black, new XRect(curX + 160, curY + 98, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(_customerpostcode, fontNormal, XBrushes.DarkBlue, new XRect(curX + 213, curY + 98, 100, 20), XStringFormat.TopLeft);
                }
                else
                {
                    gfx.DrawString(_secondline.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 3, curY + 88, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(_address[3].ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 3, curY + 98, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(" Postal code", fontNormal, XBrushes.Black, new XRect(curX + 160, curY + 98, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(_customerpostcode, fontNormal, XBrushes.DarkBlue, new XRect(curX + 213, curY + 98, 100, 20), XStringFormat.TopLeft);
                }
            }
            else if (_address.Length == 3)
            {
                string _secondline = _address[1].ToString() + "," + _address[2].ToString();
                gfx.DrawString(" #" + _customerunitno + " - " + _customerhomeno + ", " + _address[0].ToString() + ",", fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 78, 100, 20), XStringFormat.TopLeft);
                if (_secondline.Length > 45)
                {
                    gfx.DrawString(_address[1].ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 3, curY + 88, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(" Postal code", fontNormal, XBrushes.Black, new XRect(curX + 160, curY + 98, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(_customerpostcode, fontNormal, XBrushes.DarkBlue, new XRect(curX + 213, curY + 98, 100, 20), XStringFormat.TopLeft);
                }
                else
                {
                    gfx.DrawString(_secondline.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 3, curY + 88, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(" Postal code", fontNormal, XBrushes.Black, new XRect(curX + 160, curY + 98, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(_customerpostcode, fontNormal, XBrushes.DarkBlue, new XRect(curX + 213, curY + 98, 100, 20), XStringFormat.TopLeft);
                }
            }
            else if (_address.Length == 2)
            {
                string _secondline = _address[1].ToString();
                gfx.DrawString(" #" + _customerunitno + " - " + _customerhomeno + ", " + _address[0].ToString() + ",", fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 78, 100, 20), XStringFormat.TopLeft);
                if (_secondline.Length > 45)
                {
                    gfx.DrawString(_address[1].ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 3, curY + 88, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(" Postal code", fontNormal, XBrushes.Black, new XRect(curX + 160, curY + 98, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(_customerpostcode, fontNormal, XBrushes.DarkBlue, new XRect(curX + 213, curY + 98, 100, 20), XStringFormat.TopLeft);
                }
                else
                {
                    gfx.DrawString(_secondline.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 3, curY + 88, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(" Postal code", fontNormal, XBrushes.Black, new XRect(curX + 160, curY + 98, 100, 20), XStringFormat.TopLeft);
                    gfx.DrawString(_customerpostcode, fontNormal, XBrushes.DarkBlue, new XRect(curX + 213, curY + 98, 100, 20), XStringFormat.TopLeft);
                }
            }
        }
        else
        {
            gfx.DrawString(" #" + _customerunitno + " - " + _customerhomeno + ",", fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 78, 100, 20), XStringFormat.TopLeft);
            gfx.DrawString(_customeraddress, fontNormal, XBrushes.DarkBlue, new XRect(curX + 3, curY + 88, 100, 20), XStringFormat.TopLeft);
            gfx.DrawString(" Postal code", fontNormal, XBrushes.Black, new XRect(curX + 160, curY + 98, 100, 20), XStringFormat.TopLeft);
            gfx.DrawString(_customerpostcode, fontNormal, XBrushes.DarkBlue, new XRect(curX + 213, curY + 98, 100, 20), XStringFormat.TopLeft);
        }

        gfx.DrawString(" NRIC / Passport no.", fontNormal, XBrushes.Black, new XRect(curX + 285, curY + 68, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_nric, fontNormal, XBrushes.DarkBlue, new XRect(curX + 287, curY + 78, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Date driving licence obtained", fontNormal, XBrushes.Black, new XRect(curX + 425, curY + 68, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_drvlicenceobtained, fontNormal, XBrushes.DarkBlue, new XRect(curX + 427, curY + 78, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Marital Status", fontNormal, XBrushes.Black, new XRect(curX + 285, curY + 88, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_customermaritalstatus, fontNormal, XBrushes.DarkBlue, new XRect(curX + 287, curY + 98, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Gender", fontNormal, XBrushes.Black, new XRect(curX + 425, curY + 88, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_customergender, fontNormal, XBrushes.DarkBlue, new XRect(curX + 427, curY + 98, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Occupation/Nature of business", fontNormal, XBrushes.Black, new XRect(curX, curY + 110, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_customeroccupation + " / " + _customerjobnature, fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 122, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Residential no.", fontNormal, XBrushes.Black, new XRect(curX + 285, curY + 110, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_homephoneno, fontNormal, XBrushes.DarkBlue, new XRect(curX + 355, curY + 110, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Office no.", fontNormal, XBrushes.Black, new XRect(curX + 425, curY + 110, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_officeno, fontNormal, XBrushes.DarkBlue, new XRect(curX + 490, curY + 110, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Mobile no.", fontNormal, XBrushes.Black, new XRect(curX + 285, curY + 122, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_mobileno, fontNormal, XBrushes.DarkBlue, new XRect(curX + 355, curY + 122, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Fax no.", fontNormal, XBrushes.Black, new XRect(curX + 425, curY + 122, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_faxno, fontNormal, XBrushes.DarkBlue, new XRect(curX + 490, curY + 122, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Name of employer", fontNormal, XBrushes.Black, new XRect(curX, curY + 132, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_employersname, fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 142, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Email address", fontNormal, XBrushes.Black, new XRect(curX + 285, curY + 132, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_emailaddress, fontNormal, XBrushes.DarkBlue, new XRect(curX + 287, curY + 142, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Please tick (√) below where applicable. Otherwise declarations will be taken as 'NO'.", fontNormal, XBrushes.Black, new XRect(curX, curY + 152, 100, 20), XStringFormat.TopLeft);
        //gfx.DrawRectangle(new XPen(_xcolor), curX + 3, curY + 162, 8, 8);
        gfx.DrawString(_last3yearsClaimXP, fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 162, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" At fault motor claims experiences in past 3 years (please provide details below)", fontNormal, XBrushes.Black, new XRect(curX + 30, curY + 162, 100, 20), XStringFormat.TopLeft);
        
        DrawBoxWithText(gfx, _xcolor, curX, curY + 173, 550, 15, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);

        DrawBoxWithText(gfx, _xcolor, curX, curY + 173, 550, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX + 100, curY + 173, 180, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX + 280, curY + 173, 110, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);

        gfx.DrawString(" Date of accident", fontNormal, XBrushes.Black, new XRect(curX + 15, curY + 175, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" Nature of accident/loss", fontNormal, XBrushes.Black, new XRect(curX + 135, curY + 175, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" Amount of claim", fontNormal, XBrushes.Black, new XRect(curX + 300, curY + 175, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" Type of claim", fontNormal, XBrushes.Black, new XRect(curX + 435, curY + 175, 100, 20), XStringFormat.TopLeft);
        curY += 175;

        DrawBoxWithText(gfx, _xcolor, curX, curY + 13, 550, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX + 100, curY + 13, 180, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX + 280, curY + 13, 110, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);

        if (_last3yearsClaimXP == "No")  
        {   _accidentdate=string.Empty;
            _natureofaccident = string.Empty;
            _claimamount = string.Empty;
            _typeofclaim = string.Empty;
        }

        gfx.DrawString(_accidentdate , fontNormal, XBrushes.DarkBlue, new XRect(curX + 5, curY + 15, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_natureofaccident, fontNormal, XBrushes.DarkBlue, new XRect(curX + 105, curY + 15, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_claimamount, fontNormal, XBrushes.DarkBlue, new XRect(curX + 285, curY + 15, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_typeofclaim , fontNormal, XBrushes.DarkBlue, new XRect(curX + 395, curY + 15, 100, 20), XStringFormat.TopLeft);
        
        curY += 15;

        DrawBoxWithText(gfx, _xcolor, curX, curY + 13, 550, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX + 100, curY + 13, 180, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX + 280, curY + 13, 110, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);

        gfx.DrawString("", fontNormal, XBrushes.DarkBlue, new XRect(curX + 5, curY + 15, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString("", fontNormal, XBrushes.DarkBlue, new XRect(curX + 105, curY + 15, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_claimsAmount2, fontNormal, XBrushes.DarkBlue, new XRect(curX + 285, curY + 15, 200, 20), XStringFormat.TopLeft);
        gfx.DrawString("", fontNormal, XBrushes.DarkBlue, new XRect(curX + 395, curY + 15, 100, 20), XStringFormat.TopLeft);
        curY += 15;

        //DrawBoxWithText(gfx, _xcolor, curX, curY + 13, 550, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        //DrawBoxWithText(gfx, _xcolor, curX + 100, curY + 13, 180, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        //DrawBoxWithText(gfx, _xcolor, curX + 280, curY + 13, 110, 15, .75, "", "Verdana", 6.0, XFontStyle.Regular);

        //gfx.DrawString("", fontNormal, XBrushes.DarkBlue, new XRect(curX + 5, curY + 15, 100, 20), XStringFormat.TopLeft);
        //gfx.DrawString("", fontNormal, XBrushes.DarkBlue, new XRect(curX + 105, curY + 15, 100, 20), XStringFormat.TopLeft);
        //gfx.DrawString(_claimsAmount3, fontNormal, XBrushes.DarkBlue, new XRect(curX + 285, curY + 15, 200, 20), XStringFormat.TopLeft);
        //gfx.DrawString("", fontNormal, XBrushes.DarkBlue, new XRect(curX + 395, curY + 15, 100, 20), XStringFormat.TopLeft);
        //curY += 15;

        //gfx.DrawRectangle(new XPen(_xcolor), curX + 3, curY + 15, 8, 8);
        gfx.DrawString(" Record of revoked/endorsed driving licence (please provide details below)", fontNormal, XBrushes.Black, new XRect(curX, curY + 15, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_isrevoked , fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 25, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" Year__________________", fontNormal, XBrushes.Black, new XRect(curX + 30, curY + 25, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_revokedyear, fontNormal, XBrushes.DarkBlue, new XRect(curX + 80, curY + 25, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" Reason_______________________________________________________________________", fontNormal, XBrushes.Black, new XRect(curX + 150, curY + 25, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_revokedreason, fontNormal, XBrushes.DarkBlue, new XRect(curX + 190, curY + 25, 100, 20), XStringFormat.TopLeft);
        curY += 15;

        //gfx.DrawRectangle(new XPen(_xcolor), curX + 3, curY + 20, 8, 8);
        gfx.DrawString(" No Claim Discount (NCD) to be transferred to this insurance policy (please provide details below)", fontNormal, XBrushes.Black, new XRect(curX, curY + 20, 100, 20), XStringFormat.TopLeft);
        //check
        gfx.DrawString(_isNCD, fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 33, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" NCD(%)____________", fontNormal, XBrushes.Black, new XRect(curX + 30, curY + 33, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_NCDPercent, fontNormal, XBrushes.DarkBlue, new XRect(curX + 80, curY + 33, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" Insurance Co:_____________________________________________________________", fontNormal, XBrushes.Black, new XRect(curX + 140, curY + 33, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_currentInsuranceCo, fontNormal, XBrushes.DarkBlue, new XRect(curX + 210, curY + 33, 100, 20), XStringFormat.TopLeft);//"Singapore Aviation and General Insurance Co (Pte) Ltd"
        //gfx.DrawString("Singapore Aviation and General Insurance Co (Pte) Ltd", fontNormal, XBrushes.Black, new XRect(curX + 190, curY + 33, 100, 20), XStringFormat.TopLeft);
        curY += 15;

        gfx.DrawString(" Vehicle Registration No.____________________", fontNormal, XBrushes.Black, new XRect(curX + 30, curY + 30, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_vehicleNo, fontNormal, XBrushes.DarkBlue, new XRect(curX + 150, curY + 30, 100, 20), XStringFormat.TopLeft);
        curY += 15;

        //gfx.DrawRectangle(new XPen(_xcolor), curX + 3, curY + 30, 8, 8);
        gfx.DrawString(" If NCD is nil or 10% with no claims experiences, please provide the reason", fontNormal, XBrushes.Black, new XRect(curX, curY + 30, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_ncdNilDetails, fontNormal, XBrushes.DarkBlue, new XRect(curX + 10, curY + 40, 100, 20), XStringFormat.TopLeft);
        curY += 15;

#endregion

#region "Section 2. Details of motor car to be insured Start"


        DrawBoxWithText(gfx, _xcolor, curX, curY + 45, 550, 190, 1.0, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX, curY + 45, 550, 14, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);
        curY += 2;
        gfx.DrawString(" 2. Details of motor car to be insured", fontBold, XBrushes.Black, new XRect(curX, curY + 45, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        DrawBoxWithText(gfx, _xcolor, curX, curY + 55, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        gfx.DrawLine(new XPen(_xcolor), curX + 135, curY + 55, curX + 135, curY + 136);
        gfx.DrawLine(new XPen(_xcolor), curX + 300, curY + 55, curX + 300, curY + 136);
        gfx.DrawLine(new XPen(_xcolor), curX + 425, curY + 55, curX + 425, curY + 136);
        curY += 2;

        gfx.DrawString(" Registration no.", fontNormal, XBrushes.Black, new XRect(curX, curY + 55, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_vehicleNo, fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 67, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Make and model", fontNormal, XBrushes.Black, new XRect(curX + 135, curY + 55, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_carMake, fontNormal, XBrushes.DarkBlue, new XRect(curX + 137, curY + 67, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Cubic capacity (cc)", fontNormal, XBrushes.Black, new XRect(curX + 300, curY + 55, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_carCC.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 302, curY + 67, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Engine Type", fontNormal, XBrushes.Black, new XRect(curX + 425, curY + 55, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_engineType, fontNormal, XBrushes.DarkBlue, new XRect(curX + 427, curY + 67, 100, 20), XStringFormat.TopLeft);

        DrawBoxWithText(gfx, _xcolor, curX, curY + 80, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;

        gfx.DrawString(" Seating capacity including driver", fontNormal, XBrushes.Black, new XRect(curX, curY + 80, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_carSeaters.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 92, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Year of registration", fontNormal, XBrushes.Black, new XRect(curX + 135, curY + 80, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_yearOfRegistration.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 137, curY + 92, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Off-peak car?", fontNormal, XBrushes.Black, new XRect(curX + 300, curY + 80, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_offPeakCar, fontNormal, XBrushes.DarkBlue, new XRect(curX + 302, curY + 92, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Without COE/PARF?", fontNormal, XBrushes.Black, new XRect(curX + 425, curY + 80, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_withoutCOEPARF, fontNormal, XBrushes.DarkBlue, new XRect(curX + 427, curY + 92, 100, 20), XStringFormat.TopLeft);

        DrawBoxWithText(gfx, _xcolor, curX, curY + 105, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;

        gfx.DrawString(" Type of Body", fontNormal, XBrushes.Black, new XRect(curX, curY + 105, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_bodyType, fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 117, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Purchase price", fontNormal, XBrushes.Black, new XRect(curX + 135, curY + 105, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_purchasePrice, fontNormal, XBrushes.DarkBlue, new XRect(curX + 137, curY + 117, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Engine number", fontNormal, XBrushes.Black, new XRect(curX + 300, curY + 105, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_engineNo, fontNormal, XBrushes.DarkBlue, new XRect(curX + 302, curY + 117, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Chassis number", fontNormal, XBrushes.Black, new XRect(curX + 425, curY + 105, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_chassisNo, fontNormal, XBrushes.DarkBlue, new XRect(curX + 427, curY + 117, 100, 20), XStringFormat.TopLeft);

        DrawBoxWithText(gfx, _xcolor, curX, curY + 130, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;

        gfx.DrawString(" Has the car been modified, converted, customized or has there been increased performance from the manufacturer’s standard", fontNormal, XBrushes.Black, new XRect(curX, curY + 130, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" specification (including any intended alterations)?", fontNormal, XBrushes.Black, new XRect(curX, curY + 140, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_isCarModified, fontNormal, XBrushes.DarkBlue, new XRect(curX + 210, curY + 140, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_modifiedReason, fontNormal, XBrushes.DarkBlue, new XRect(curX + 3, curY + 150, 100, 20), XStringFormat.TopLeft);
        curY += 2;

        DrawBoxWithText(gfx, _xcolor, curX, curY + 160, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;

        gfx.DrawString(" Name of hire purchase owner(s), if any ", fontNormal, XBrushes.Black, new XRect(curX, curY + 162, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_hpCompanyName, fontNormal, XBrushes.DarkBlue, new XRect(curX + 210, curY + 162, 100, 20), XStringFormat.TopLeft);
        curY += 2;

        DrawBoxWithText(gfx, _xcolor, curX, curY + 177, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;

        gfx.DrawString(" State the purpose for which the car will be used", fontNormal, XBrushes.Black, new XRect(curX, curY + 180, 100, 20), XStringFormat.TopLeft);
        //gfx.DrawString(" Social, domestic and pleasure purposes and business of the proposer, proposer’s employer or partner.", fontNormal, XBrushes.Black, new XRect(curX, curY + 190, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_purposeOfUse.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 10, curY + 190, 100, 20), XStringFormat.TopLeft);
        //gfx.DrawString(_purposeOfUse.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 425, curY + 190, 100, 20), XStringFormat.TopLeft);
        //gfx.DrawString(" Others, please specify ", fontNormal, XBrushes.Black, new XRect(curX , curY + 200, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        
#endregion

#region "Section 3. Details of insurance required Start"


        DrawBoxWithText(gfx, _xcolor, curX, curY + 218, 550, 120, 1.0, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX, curY + 218, 550, 19, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);
        curY += 2;
        gfx.DrawString(" 3. Details of insurance required", fontBold, XBrushes.Black, new XRect(curX, curY + 220, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        DrawBoxWithText(gfx, _xcolor, curX, curY + 233, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx, _xcolor, curX, curY + 263, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        gfx.DrawLine(new XPen(_xcolor), curX + 290, curY + 233, curX + 290, curY + 263);
        curY += 2;

        gfx.DrawString(" Period of insurance required", fontNormal, XBrushes.Black, new XRect(curX, curY + 235, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" From " + _insStartDate + "  To midnight of " + _insEndDate, fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 245, 100, 20), XStringFormat.TopLeft);

        gfx.DrawString(" Own Damage excess S$_____________________", fontNormal, XBrushes.Black, new XRect(curX + 290, curY + 235, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_ownDamageExcess.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 392, curY + 235, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" (This is the amount you will be required to contribute towards each claim for", fontSmall, XBrushes.Black, new XRect(curX + 290, curY + 244, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(" accidental damage to the insured Motor Car.)", fontSmall, XBrushes.Black, new XRect(curX + 290, curY + 251, 100, 20), XStringFormat.TopLeft);
        curY += 2;

        gfx.DrawLine(new XPen(_xcolor), curX + 175, curY + 259, curX + 175, curY + 330);
        curY += 2;

        gfx.DrawString(" State insurance cover required", fontNormal, XBrushes.Black, new XRect(curX, curY + 261, 100, 20), XStringFormat.TopLeft);
        gfx.DrawString(_typeofcover, fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 275, 100, 20), XStringFormat.TopLeft);
                
        if (_NCDProtector.ToLower() == "true")
        {
            curY += 7;
            gfx.DrawString("(+) Include NCD Protection", fontNormal, XBrushes.DarkBlue, new XRect(curX + 4, curY + 275, 100, 20), XStringFormat.TopLeft);
        }

        gfx.DrawString(" Coverage for optional items (additional premium applies)", fontNormal, XBrushes.Black, new XRect(curX + 175, curY + 261, 100, 20), XStringFormat.TopLeft);
        //gfx.DrawString(" ", fontNormal, XBrushes.DarkBlue, new XRect(curX + 175, curY + 275, 100, 20), XStringFormat.TopLeft);

        curY += 2;
        str = "  Please tick (√) appropriate item(s) if you require coverage";
        gfx.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 175, curY + 269, 100, 20), XStringFormat.TopLeft);

        if (_NCDProtector.ToLower() == "true")
        {
            str = "  √                                                                                         □";
            gfx.DrawString(str, fontBold, XBrushes.Black, new XRect(curX + 175, curY + 278, 100, 20), XStringFormat.TopLeft);
        }
        else 
        {
            str = "  □                                                                                          □";
            gfx.DrawString(str, fontBold, XBrushes.Black, new XRect(curX + 175, curY + 278, 100, 20), XStringFormat.TopLeft);
        }

        str = "      No Claim Discount Protection                                                         Solar Film";
        gfx.DrawString(str, fontMediumBold, XBrushes.Black, new XRect(curX + 175, curY + 280, 100, 20), XStringFormat.TopLeft);

        str = "(Applicable to 50% NCD only)";
        gfx.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 310, curY + 280, 100, 20), XStringFormat.TopLeft);
        str = "  □                                                                                          □";
        gfx.DrawString(str, fontBold, XBrushes.Black, new XRect(curX + 175, curY + 288, 100, 20), XStringFormat.TopLeft);
        str = "      10 Days Loss of Use Car Replacement                                           Glassroof/Canvas cover";
        gfx.DrawString(str, fontMediumBold, XBrushes.Black, new XRect(curX + 175, curY + 290, 100, 20), XStringFormat.TopLeft);
        str = "(1500 - 1600cc)";
        gfx.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 340, curY + 290, 100, 20), XStringFormat.TopLeft);

        str = "  □";
        gfx.DrawString(str, fontBold, XBrushes.Black, new XRect(curX + 175, curY + 298, 100, 20), XStringFormat.TopLeft);
        str = "      Any Workshop Extension";
        gfx.DrawString(str, fontMediumBold, XBrushes.Black, new XRect(curX + 175, curY + 300, 100, 20), XStringFormat.TopLeft);

        str = "  □";
        gfx.DrawString(str, fontBold, XBrushes.Black, new XRect(curX + 175, curY + 308, 100, 20), XStringFormat.TopLeft);
        str = "      Fixtures and Accessories";
        gfx.DrawString(str, fontMediumBold, XBrushes.Black, new XRect(curX + 175, curY + 310, 100, 20), XStringFormat.TopLeft);
        str = "(please provide details and attach invoice) ________________________________";
        gfx.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 290, curY + 312, 100, 20), XStringFormat.TopLeft);
        
#endregion

        //Page 2
        // Create an empty page
        PdfPage page2 = document.AddPage();

        // Get an XGraphics object for drawing
        XGraphics gfx2 = XGraphics.FromPdfPage(page2);

        curX = 35;
        curY = 15;

#region "Section 4. Details of main driver/named driver"

        //DrawBoxWithText(gfx2,_xcolor, curX, curY + 35, 550, 200, 1.0, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 25, 550, 170, 1.0, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 25, 550, 22, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);
        curY += 2;
        gfx2.DrawString(" 4. Details of main driver / named driver", fontBold, XBrushes.Black, new XRect(curX, curY + 25, 100, 20), XStringFormat.TopLeft);

        gfx2.DrawString("      Fill in this section with details of main driver/named driver who frequently uses this car " +
                "(Refer to Unnamed Driver Excess under Section 7)", fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 35, 100, 20), XStringFormat.TopLeft);
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 45, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;
        str = " Please tick (√) below where applicable. Otherwise declarations will be taken as 'No'.";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 45, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        str = " Driver's Name (1):______________________________";
        str = str + " Date of birth (dd/mm/yy):______________";
        str = str + " Date driving licence obtained:_________";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 55, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1Name, fontNormal, XBrushes.DarkBlue, new XRect(curX + 80, curY + 55, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1DOB, fontNormal, XBrushes.DarkBlue, new XRect(curX + 330, curY + 55, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1licenceobtained, fontNormal, XBrushes.DarkBlue, new XRect(curX + 510, curY + 55, 100, 20), XStringFormat.TopLeft);



        str = " Occupation:____________________________________";
        str = str + "                            Relationship to Proposer: _______________________________";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 65, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1Occupation, fontNormal, XBrushes.DarkBlue, new XRect(curX + 60, curY + 65, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1relationshiptoProposer, fontNormal, XBrushes.DarkBlue, new XRect(curX + 420, curY + 65, 100, 20), XStringFormat.TopLeft);

        str = "  □ Record of revoked/endorsed driving licence (please provide details)       ";
        str = str + "   Year: _________     Reason: __________________________";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 75, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1isrevoked , fontNormal, XBrushes.DarkBlue, new XRect(curX + 275, curY + 75, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1revokedyear, fontNormal, XBrushes.DarkBlue, new XRect(curX + 330, curY + 75, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1revokedreason, fontNormal, XBrushes.DarkBlue, new XRect(curX + 420, curY + 75, 100, 20), XStringFormat.TopLeft);
        //
        str = "  □ At fault motor claims experiences in past 3 years(please provide details below)";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 85, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1isfaultclaim, fontNormal, XBrushes.DarkBlue, new XRect(curX + 330, curY + 85, 100, 20), XStringFormat.TopLeft);

        DrawBoxWithText(gfx2, _xcolor, curX, curY + 94, 550, 12, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);

        DrawBoxWithText(gfx2, _xcolor, curX, curY + 95, 100, 10, .75, "Date of accident", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 100, curY + 95, 200, 10, .75, "Nature of accident/loss", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 300, curY + 95, 100, 10, .75, "Amount of claim", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 400, curY + 95, 150, 10, .75, "Type of claim", "Verdana", 6.0, XFontStyle.Regular);

        gfx2.DrawString(_driver1accidentdate, fontNormal, XBrushes.DarkBlue, new XRect(curX + 5, curY + 105, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1natureofaccident, fontNormal, XBrushes.DarkBlue, new XRect(curX + 105, curY + 105, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1claimamount, fontNormal, XBrushes.DarkBlue, new XRect(curX + 305, curY + 105, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver1typeofclaim, fontNormal, XBrushes.DarkBlue, new XRect(curX + 405, curY + 105, 100, 20), XStringFormat.TopLeft);
        
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 105, 100, 10, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 100, curY + 105, 200, 10, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 300, curY + 105, 100, 10, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 400, curY + 105, 150, 10, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        //DrawBoxWithText(gfx2, _xcolor, curX, curY + 110, 550, 5, 1.0, "", "Verdana", 6.0, XFontStyle.Regular);
        //curY += 90;
        //DrawBoxWithText(gfx2, _xcolor, curX, curY + 150, 550, 10, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        //DrawBoxWithText(gfx2, _xcolor, curX, curY + 150, 550, 0, .65, "", "Verdana", 6.0, XFontStyle.Regular);

        curY += 55;
        str = " Driver's Name (2):______________________________";
        str = str + " Date of birth (dd/mm/yy):______________";
        str = str + " Date driving licence obtained:_________";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 65, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2Name, fontNormal, XBrushes.DarkBlue, new XRect(curX + 80, curY + 65, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2DOB, fontNormal, XBrushes.DarkBlue, new XRect(curX + 330, curY + 65, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2licenceobtained, fontNormal, XBrushes.DarkBlue, new XRect(curX + 510, curY + 65, 100, 20), XStringFormat.TopLeft);
        //gfx2.DrawString("", fontNormal, XBrushes.DarkBlue, new XRect(curX + 2, curY + 455, 100, 20), XStringFormat.TopLeft);
      
        str = " Occupation:____________________________________";
        str = str + "                            Relationship to Proposer: _______________________________";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 75, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2Occupation, fontNormal, XBrushes.DarkBlue, new XRect(curX + 60, curY + 75, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2relationshiptoProposer, fontNormal, XBrushes.DarkBlue, new XRect(curX + 420, curY + 75, 100, 20), XStringFormat.TopLeft);

        str = "  □ Record of revoked/endorsed driving licence (please provide details)       ";
        str = str + "   Year: _________     Reason: __________________________";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 85, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2isrevoked, fontNormal, XBrushes.DarkBlue, new XRect(curX + 275, curY + 85, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2revokedyear, fontNormal, XBrushes.DarkBlue, new XRect(curX + 330, curY + 85, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2revokedreason, fontNormal, XBrushes.DarkBlue, new XRect(curX + 420, curY + 85, 100, 20), XStringFormat.TopLeft);
        
        str = "  □ At fault motor claims experiences in past 3 years(please provide details below)";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 95, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2isfaultclaim , fontNormal, XBrushes.DarkBlue, new XRect(curX + 330, curY + 95, 100, 20), XStringFormat.TopLeft);

        DrawBoxWithText(gfx2, _xcolor, curX, curY + 104, 550, 12, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);

        DrawBoxWithText(gfx2, _xcolor, curX, curY + 105, 100, 10, .75, "Date of accident", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 100, curY + 105, 200, 10, .75, "Nature of accident/loss", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 300, curY + 105, 100, 10, .75, "Amount of claim", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 400, curY + 105, 150, 10, .75, "Type of claim", "Verdana", 6.0, XFontStyle.Regular);

        gfx2.DrawString(_driver2accidentdate, fontNormal, XBrushes.DarkBlue, new XRect(curX + 5, curY + 115, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2natureofaccident, fontNormal, XBrushes.DarkBlue, new XRect(curX + 105, curY + 115, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2claimamount, fontNormal, XBrushes.DarkBlue, new XRect(curX + 305, curY + 115, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_driver2typeofclaim, fontNormal, XBrushes.DarkBlue, new XRect(curX + 405, curY + 115, 100, 20), XStringFormat.TopLeft);

        DrawBoxWithText(gfx2, _xcolor, curX, curY + 115, 100, 10, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 100, curY + 115, 200, 10, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 300, curY + 115, 100, 10, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 400, curY + 115, 150, 10, .75, "", "Verdana", 6.0, XFontStyle.Regular);

#endregion

#region "Section 5 Payment mode"

        curY += 104;
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 35, 550, 120, 1.0, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 35, 550, 14, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);
        curY += 2;
        gfx2.DrawString(" 5. Payment mode", fontBold, XBrushes.Black, new XRect(curX, curY + 35, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 45, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 45, 200, 20, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX + 200, curY + 45, 350, 20, .75, "", "Verdana", 6.0, XFontStyle.Regular);
        curY += 2;
        str = "Total Premium Payable: S$";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 45, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_totalPremium.ToString(), fontNormal, XBrushes.DarkBlue, new XRect(curX + 110, curY + 45, 100, 20), XStringFormat.TopLeft);

        curY += 10;
        //str = " I/we authorised HSBC Insurance (Singapore) Pte. Limited to debit the premium amount due in connection ";
        //str = str + "with above insurance policy to my nominated";
        //gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 55, 100, 20), XStringFormat.TopLeft);
        str = " I/we authorised ";
        //str = str + "with above insurance policy to my nominated";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 55, 100, 20), XStringFormat.TopLeft);
        str = "HSBC Insurance (Singapore) Pte. Limited  ";
        //str = str + "with above insurance policy to my nominated";
        gfx2.DrawString(str, fontSmallBold, XBrushes.Black, new XRect(curX + 62, curY + 55, 100, 20), XStringFormat.TopLeft);
        str = " to debit the premium amount due in connection ";
        str = str + "with above insurance policy to my nominated";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 207, curY + 55, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        str = " Credit Card Account. Where a third party Credit Card is used, I declared that the cardholder has authorised and consented to its use.";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 65, 100, 20), XStringFormat.TopLeft);

        curY += 2;
        str = " Name as on card:___________________________________________  Issuing Bank: XXXXXX XXXXXXX";//Sakthi on 08 Dec 2010     Installment Type: " + _installmentType;
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 75, 100, 20), XStringFormat.TopLeft);
        gfx2.DrawString(_cardholdersName, fontNormal, XBrushes.DarkBlue, new XRect(curX + 80, curY + 75, 100, 20), XStringFormat.TopLeft);
        //gfx2.DrawString(_issuingBank, fontNormal, XBrushes.Black, new XRect(curX + 360, curY + 75, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        str = " Credit Card number:   XXXX XXXX XXXX XXXX                                     Card expiry date: XX / XX";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 85, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        str = "  XXXXX (Only VISA or Master Credit Card is acceptable for premium payment)";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 95, 100, 20), XStringFormat.TopLeft);
        //gfx2.DrawString(_cardType, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 95, 100, 20), XStringFormat.TopLeft);
        curY += 5;
        str = " By signing this proposal form, I am aware that any refund will be paid by cheque to the Insured/Policyholder. ";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 105, 100, 20), XStringFormat.TopLeft);
        str = " HSBC Insurance (Singapore) Pte Limited";
        gfx2.DrawString(str, fontSmallBold, XBrushes.Black, new XRect(curX + 340, curY + 105, 100, 20), XStringFormat.TopLeft);;
        //str = " By signing this proposal form, I am aware that any refund will be paid by cheque to the Insured/Policyholder. HSBC Insurance (Singapore) Pte Limited";
        //gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 105, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        str = " will consider all declared information as true and correct. This Credit Card payment is subject to the terms of the Credit Card Agreement.";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 115, 100, 20), XStringFormat.TopLeft);

#endregion

#region "Section 6 Important notice to proposer"

        //6. Important notice to proposer
        curY += 95;
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 35, 550, 110, 1.0, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 35, 550, 14, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);
        curY += 2;
        gfx2.DrawString(" 6. Important notice to proposer", fontBold, XBrushes.Black, new XRect(curX, curY + 35, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 45, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);

        str = "   1. Please ensure that the information provided in this proposal form is complete and accurate to your best knowledge.";
        str = str + "Failure to disclose any facts that the Company would";
        gfx2.DrawString(str, fontSmall, XBrushes.Red, new XRect(curX + 2, curY + 55, 100, 20), XStringFormat.TopLeft);

        str = "      regard as likely to affect the acceptance and assessment of this proposal could result in your insurance being declared invalid.";
        str = str + "If you have any doubt about whetere a particular";
        gfx2.DrawString(str, fontSmall, XBrushes.Red, new XRect(curX + 2, curY + 65, 100, 20), XStringFormat.TopLeft);


        str = "      fact should be declared, you should disclose it.";
        gfx2.DrawString(str, fontSmall, XBrushes.Red, new XRect(curX + 2, curY + 75, 100, 20), XStringFormat.TopLeft);


        str = "   2. This document is not a contract of insurance. The specific terms, conditions and exclusions applicable to the insurance are set out in the Policy. This insurance will not be in";
        gfx2.DrawString(str, fontSmall, XBrushes.Red, new XRect(curX + 2, curY + 85, 100, 20), XStringFormat.TopLeft);


        str = "      force until the proposal has been accepted by the Company and premium paid.";
        gfx2.DrawString(str, fontSmall, XBrushes.Red, new XRect(curX + 2, curY + 95, 100, 20), XStringFormat.TopLeft);


        str = "   3. A specimen copy of the policy contract is available on request.";
        gfx2.DrawString(str, fontSmall, XBrushes.Red, new XRect(curX + 2, curY + 105, 100, 20), XStringFormat.TopLeft);


        str = "   4. Please note that all policies, renewal certificates, cover notes, endorsements for policies carry a Payment Before Cover Warranty for individual policyholders and a Premium";
        gfx2.DrawString(str, fontSmall, XBrushes.Red, new XRect(curX + 2, curY + 115, 100, 20), XStringFormat.TopLeft);


        str = "       Payment Warranty for companies and businesses, which requires the premium to be paid in full within a specific period failing which there would be no liability under the policy.";
        gfx2.DrawString(str, fontSmall, XBrushes.Red, new XRect(curX + 2, curY + 125, 100, 20), XStringFormat.TopLeft);

#endregion

#region "Section 7. Declaration"
        //7. Declaration
        curY += 112;
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 35, 550, 260, 1.0, "", "Verdana", 6.0, XFontStyle.Regular);
        DrawBoxWithText(gfx2, _xcolor, curX, curY + 35, 550, 13, 1.0, "", "Verdana", 6.0, XFontStyle.Regular, XBrushes.LightGray);
        curY += 2;
        gfx2.DrawString(" 7. Declaration", fontBold, XBrushes.Black, new XRect(curX, curY + 35, 100, 20), XStringFormat.TopLeft);

        DrawBoxWithText(gfx2, _xcolor, curX, curY + 45, 550, 0, .75, "", "Verdana", 6.0, XFontStyle.Regular);

        str = "   I/We unserstand and declare that";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 55, 100, 20), XStringFormat.TopLeft);
        curY += 2;
        //str = "   1. No Claim Discount - No Claim Discount (NCD) is accurate as stated and a cancellation of cover with existing/ex-insurer ";
        //str = str + "has to be effected in order for the declared NCD to be";
        //gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 65, 100, 20), XStringFormat.TopLeft);
        str = "   1. No Claim Discount";
        gfx2.DrawString(str, fontSmallBold, XBrushes.Black, new XRect(curX + 2, curY + 65, 100, 20), XStringFormat.TopLeft);

        str = " - No Claim Discount (NCD) is accurate as stated and a cancellation of cover with existing/ex-insurer ";
        str = str + "has to be effected in order for the declared NCD to";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 78, curY + 65, 100, 20), XStringFormat.TopLeft);

        str = "      be applied from the inception of this risk proposed.";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 75, 100, 20), XStringFormat.TopLeft);

        //str = "   2. Unnamed Driver Excess - If the Insured Motor car is driven by any unnamed driver other than the Insured's spouse at the time of accident, ";
        //str = str + "an additional excess of S$500";
        //gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 85, 100, 20), XStringFormat.TopLeft);

        str = "   2. Unnamed Driver Excess";
        gfx2.DrawString(str, fontSmallBold, XBrushes.Black, new XRect(curX + 2, curY + 85, 100, 20), XStringFormat.TopLeft);

        str = " - If the Insured Motor car is driven by any unnamed driver other than the Insured's spouse at the time of accident, ";
        str = str + "an additional excess of S$500";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 92, curY + 85, 100, 20), XStringFormat.TopLeft);

        str = "      under Section I will apply. However, if the unnamed driver (including the Insured's spouse) is below 26 years old and/or ";
        str = str + "has less than 2 years of valid driving licence to drive in";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 95, 100, 20), XStringFormat.TopLeft);


        str = "      Singapore for the relevant class of vehicle, an additional young and/or inexperienced driver excess of S$3,500 will apply. If the authorised driver is declared and named in the";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 105, 100, 20), XStringFormat.TopLeft);


        str = "      policy, a lower excess may apply (subject to underwriting by the Company). This clause does not apply to Named Driver(s) Only Policies.";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 115, 100, 20), XStringFormat.TopLeft);

        str = "   3. Appointed Workshop Scheme";
        gfx2.DrawString(str, fontSmallBold, XBrushes.Black, new XRect(curX + 2, curY + 125, 100, 20), XStringFormat.TopLeft);

        str = "      a) Under Premier Plan, all accident repairs must be carried out by HSBC’s appointed workshops. However, if the car is still under manufacturer’s original warranty, repairs can";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 135, 100, 20), XStringFormat.TopLeft);

        str = "          be carried out by the sole distributor’s workshop.";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 145, 100, 20), XStringFormat.TopLeft);

        str = "      b) Under Classic Plan, all accident repairs must be carried out by HSBC’s appointed workshops.";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 155, 100, 20), XStringFormat.TopLeft);

        //str = "   4. Cancellation of Policy – HSBC may cancel this Policy by giving 7 days’ notice to the Insured and will return to the Insured the premium paid less the pro rata portion thereof";
        //gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 165, 100, 20), XStringFormat.TopLeft);

        str = "   4. Cancellation of Policy";
        gfx2.DrawString(str, fontSmallBold, XBrushes.Black, new XRect(curX + 2, curY + 165, 100, 20), XStringFormat.TopLeft);

        str = " – HSBC may cancel this Policy by giving 7 days’ notice to the Insured and will return to the Insured the premium paid less the pro rata portion ";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 92, curY + 165, 100, 20), XStringFormat.TopLeft);

        str = "     thereof for the period the Policy has been in force which amount the Insured has become liable to pay (the “Unused portion of the premium”).Insured may cancel this Policy by";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 175, 100, 20), XStringFormat.TopLeft);

        str = "      giving 7 days’ notice to HSBC and shall be entitled to a return of 80% of the Unused portion of the premium. Provided always that in each event no claim has arisen or been";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 185, 100, 20), XStringFormat.TopLeft);
        str = "      reported prior to the cancellation and the Insured shall return the current Certificate(s) of Insurance on or before date of cancellation and pay premium due promptly";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 195, 100, 20), XStringFormat.TopLeft);
        str = "   5. The above mentioned motor car is and will be kept in good condition and I/we do hereby warrant the truth of the particulars and answers given herein and that I/we have";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 205, 100, 20), XStringFormat.TopLeft);
        str = "      withheld no information whatever that might tend in any way increase the Company’s risk or to influence the decision of the Company regarding this proposal. I/We agree to";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 215, 100, 20), XStringFormat.TopLeft);
        str = "      accept a policy subject to the provisions and conditions of such policy, and to the amount of the excess imposed. I/We agree that this proposal and declaration shall be the";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 225, 100, 20), XStringFormat.TopLeft);
        str = "      basis of the contract between me/us and the Company";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 235, 100, 20), XStringFormat.TopLeft);
        str = "   6. I/We agree that where HSBC considers necessary or appropriate, it may transfer data, details or information to the appointed service provider(s) whether situated in or outside";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 245, 100, 20), XStringFormat.TopLeft);
        str = "      Singapore, under conditions of confidentiality imposed on such service providers, for the purpose of data processing or providing any service on my/our behalf. The appointed";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 255, 100, 20), XStringFormat.TopLeft);
        str = "      service providers may be required by law to disclose information received from me/us to third parties. Such circumstances include the service provider(s) being compelled to";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 265, 100, 20), XStringFormat.TopLeft);
        str = "      disclose information pursuant to a court order, police investigations and criminal prosecutions for tax evasion or other offences.";
        gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 275, 100, 20), XStringFormat.TopLeft);
        //str = "";
        //gfx2.DrawString(str, fontSmall, XBrushes.Black, new XRect(curX + 2, curY + 285, 100, 20), XStringFormat.TopLeft);

#endregion

        str = "Declared By";
        gfx2.DrawString(str, fontBold, XBrushes.Black, new XRect(curX + 2, curY + 295, 100, 20), XStringFormat.TopLeft);
        str = "Signature of proposer: _________________________________                 Company stamp (if applicable):_____________________";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 308, 100, 20), XStringFormat.TopLeft);
        str = "Date:_________________";
        gfx2.DrawString(str, fontNormal, XBrushes.Black, new XRect(curX + 2, curY + 321, 100, 20), XStringFormat.TopLeft);


        HttpUtility _server = new HttpUtility();
        string _filePath = GetFilePathHsbc();
        string filename = _filePath + strfilename + ".pdf";


        System.IO.MemoryStream stream = new System.IO.MemoryStream();
        document.Save(filename);
        stream.Close();
        document.Close();

        return filename;
    }

    public void ClearFields()
    {
        _proposalNo = "";
        _pageTitle = "Motor Insurance Proposal";

        _revisionNo = "";
        _quotationNo = "";
        _producerCode = "";
        _Applicationdate = CE.Global.General.GetUTCDateTime();

        
        #region Customer Profile

        _customerName = "";
        _customerdob = ""; // CE.Global.General.GetUTCDateTime();
        _nationality = "";
        _nric = "";
        _drvlicenceobtained = "";
        _customermaritalstatus = "";
        _customergender = "";
        _customeraddress = "";
        _customerunitno = "";
        _customerhomeno = "";
        _customerpostcode = "";
        _customeroccupation = "";
        _customerjobnature = "";
        _mobileno = "";
        _homephoneno = "";
        _officeno = "";
        _faxno = "";
        _employersname = "";
        _emailaddress = "";

        #endregion

        #region ClaimDetails

        _last3yearsClaimXP = "";
        _noClaimsLast3Years = "";
        _claimsAmount1 = "";
        _claimsAmount2 = "";
        _claimsAmount3 = "";
        _NCDPercent = "";
        _NCDProtector = "";
        _ncdNilDetails = "";

        #endregion

        #region Vehicle Details

        _vehicleNo = "";
        _carMake = "";
        _carModel = "";
        _carCC = 0;
        _engineType = "";
        _carSeaters = 0;
        _yearOfRegistration = 0;
        _offPeakCar = "";
        _withoutCOEPARF = "";
        _bodyType = "";
        _purchasePrice = "";
        _engineNo = "";
        _chassisNo = "";
        _yearOfManufacture = 0;

        #endregion

        #region Other Info

        _isCarModified = "";
        _modifiedReason = "";
        _isHPCompany = false;
        _hpCompanyName = "";
        _socialUse = false;
        _insStartDate = "";
        _insEndDate = "";
        _ownDamageExcess = "";
        _planName = "";
        _isConvictedOfMotoringOffense = false;
        _convictedReason = "";
        _isGivenDemeritPoints = false;
        _demeritPointsReason = "";
        _isDisabled = false;
        _disablityReason = "";
        _isRefusedMotorInsurance = false;
        _refusedReason = "";
        _isTerminatedDueToPayment = false;
        _terminatedReason = "";

        #endregion

        #region Addtnal Drivers

        _driver1Name = "John Tn";
        _driver1Gender = "";
        _driver1DOB = "";// CE.Global.General.GetUTCDateTime();
        _driver1Occupation = "";
        _driver1JobNature = "";
        _driver1MaritalStatus = "";
        _driver1DrivingExperience = 0;

        _driver2Name = "";
        _driver2Gender = "";
        _driver2DOB = "";// CE.Global.General.GetUTCDateTime();
        _driver2Occupation = "";
        _driver2JobNature = "";
        _driver2MaritalStatus = "";
        _driver2DrivingExperience = 0;

        _driver3Name = "";
        _driver3Gender = "";
        _driver3DOB = "";// CE.Global.General.GetUTCDateTime();
        _driver3Occupation = "";
        _driver3JobNature = "";
        _driver3MaritalStatus = "";
        _driver3DrivingExperience = 0;

        _driver4Name = "";
        _driver4Gender = "";
        _driver4DOB = "";// CE.Global.General.GetUTCDateTime();
        _driver4Occupation = "";
        _driver4JobNature = "";
        _driver4MaritalStatus = "";
        _driver4DrivingExperience = 0;

        _driver5Name = "";
        _driver5Gender = "";
        _driver5DOB = "";// CE.Global.General.GetUTCDateTime();
        _driver5Occupation = "";
        _driver5JobNature = "";
        _driver5MaritalStatus = "";
        _driver5DrivingExperience = 0;

        #endregion

        #region Policy Details

        _financeCo = "";
        _usage = "";
        _typeofcover = "";
        _periodFrom = CE.Global.General.GetUTCDateTime();
        _periodTo = CE.Global.General.GetUTCDateTime();
        _currentInsuranceCo = "";
        _policyNo = "";
        _expiryCancellationDate = CE.Global.General.GetUTCDateTime();

        #endregion

        #region Payment Details
        _excess = 0;
        _totalPremium = "";
        _cardType = "";
        _cardNo = "";
        _cardExpiryMonth = "";
        _cardExpiryYear = "";
        _cardholdersName = "";
        _issuingBank = "";
        #endregion

    }

}
